import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
/**
 * Generated class for the ServicecasePage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-servicecase',
  templateUrl: 'servicecase.html',
})
export class ServicecasePage {
  public servList = [];
  constructor(public navCtrl: NavController, public navParams: NavParams) {
    this.servList = [
      {"Servlogo" : "../../assets/imgs/fwal/1曹操.jpg"},
      {"Servlogo" : "../../assets/imgs/fwal/2浙江大学.jpg"},
      {"Servlogo" : "../../assets/imgs/fwal/3液化空气.jpg"},
      {"Servlogo" : "../../assets/imgs/fwal/4吉利.jpg"},
      {"Servlogo" : "../../assets/imgs/fwal/5李宁.jpg"},
      {"Servlogo" : "../../assets/imgs/fwal/6soho.jpg"},
      {"Servlogo" : "../../assets/imgs/fwal/7超威.jpg"},
      {"Servlogo" : "../../assets/imgs/fwal/8顺丰.jpg"},
      {"Servlogo" : "../../assets/imgs/fwal/9网易.jpg"},
      {"Servlogo" : "../../assets/imgs/fwal/10小米.jpg"}
    ]
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad ServicecasePage');
  }
  //下滑动加载数据
  doInfinite(infiniteScroll){
    setTimeout(() => {
      infiniteScroll.complete();
       var logoLen  =this.servList.length;
       if(logoLen < 28){
         this.servList = this.servList.concat([
           {"Servlogo" : "../../assets/imgs/fwal/11链家.jpg"},
           {"Servlogo" : "../../assets/imgs/fwal/12IDG资本.jpg"},
           {"Servlogo" : "../../assets/imgs/fwal/13一汽.jpg"},
           {"Servlogo" : "../../assets/imgs/fwal/14方太.jpg"},
           {"Servlogo" : "../../assets/imgs/fwal/15龙湖地产.jpg"},
           {"Servlogo" : "../../assets/imgs/fwal/16INXX.jpg"},
           {"Servlogo" : "../../assets/imgs/fwal/17环球捕手.jpg"},
           {"Servlogo" : "../../assets/imgs/fwal/18东家.jpg"},
           {"Servlogo" : "../../assets/imgs/fwal/19销冠科技.jpg"},
           {"Servlogo" : "../../assets/imgs/fwal/20巴比特.jpg"},
           {"Servlogo" : "../../assets/imgs/fwal/21卖好车.jpg"},
           {"Servlogo" : "../../assets/imgs/fwal/22乐刻.jpg"},
           {"Servlogo" : "../../assets/imgs/fwal/23个推.jpg"},
           {"Servlogo" : "../../assets/imgs/fwal/24湖畔山南资本.jpg"},
           {"Servlogo" : "../../assets/imgs/fwal/25天使湾创投.jpg"},
           {"Servlogo" : "../../assets/imgs/fwal/26上上签.jpg"},
           {"Servlogo" : "../../assets/imgs/fwal/27E修鸽.jpg"},
           {"Servlogo" : "../../assets/imgs/fwal/万科.jpg"}
         ])
       }
      if(logoLen==28){
        //如果都加载完成的情况，就直接 disable ，移除下拉加载
        infiniteScroll.enable(false);
        //toast提示
      }
    }, 1000);
  }
  //下拉刷型界面
  doRefresh(refresher){
    setTimeout(() => {
      console.log('加载完成后，关闭刷新');
      refresher.complete();
    }, 1000);
  }

}
